package com.arpa.wms.domain.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;

/**
 * 拣货明细单状态
 * @program: wms
 * @description:
 * @author: xuyang
 * @create: 2020-10-22 10:21
 */
public enum PickingRegisterStatusEnum implements IEnum<String> {
    /**
     * 拣货明细单状态
     */
    NOT_PICK("0", "未拣货"),
    // 为了与拣货单主表的状态保持一致，避免记忆错误，跳过了1
    FINISH_PICKING("2", "已拣货");

    /**
     * 值
     */
    private final String value;

    /**
     * 描述
     */
    private final String desc;

    /**
     * 将值翻译为描述
     * @param value
     * @return
     */
    public static String translate(String value){
        for (PickingRegisterStatusEnum item : PickingRegisterStatusEnum.values()){
            if (item.getValue().equals(value)){
                return item.getDesc();
            }
        }
        return value;
    }

    PickingRegisterStatusEnum(final String value, final String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public String getValue() {
        return this.value;
    }

    @Override
    public String toString(){
        return this.desc;
    }

    public String getDesc() {
        return this.desc;
    }
}
